package cn.gok.oop;

/**
 * @ClassName 封装
 * @Description TODO
 * @Author HP
 * @Date 11:16 2022/7/5
 * @Version 1.0
 **/
class Book{
    private String bookName;
    private int pageCount;

    public Book() {
    }

    public Book(String bookName, int pageCount) {
        this.bookName = bookName;
        this.pageCount = pageCount;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ", pageCount=" + pageCount +
                '}';
    }
}

public class 封装 {
    public static void main(String[] args) {
        Book book = new Book();
        book.setBookName("ads");
        book.setPageCount(123);
    }
}
